﻿@using Huatek.Torch.Promotions.APP.ViewModel;
@using Huatek.Torch.Promotions.APP.Extensions;
@using Huatek.Torch.Promotions.Domain.Enum;
@model PromotionDto;

@{
    ViewData["Title"] = "修改";
    var PromotionTypeItems = ViewData["PromotionTypes"];
    var PromotionStateItems = ViewData["PromotionStates"];
    var PromotionProductTypeItems = ViewData["PromotionProductTypes"];

}

<h1>修改</h1>
<hr />
@if (Model.PromotionProductType != PromotionProductType.All)
{
    <a asp-action="Products" asp-route-id="@Model.Id">设置商品</a> 
    @:|
}else{
    @:此活动类型为所有商品参与活动
}
<a asp-action="Index">返回列表</a>
<hr />
<div class="row">
    <div class="col-md-4">
        <form asp-action="Edit" method="post">
            <input asp-for="Id" type="hidden" />
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="Title" class="control-label"></label>：
                <input asp-for="Title" class="form-control" />
                <span asp-validation-for="Title" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Description" class="control-label"></label>：
                <input asp-for="Description" class="form-control" />
                <span asp-validation-for="Description" class="text-danger"></span>
            </div>
            <div class="form-group">
                <input asp-for="PromotionTypeId" type="hidden" />
                <label asp-for="PromotionTypeId" class="control-label"></label>：<br />
                <select disabled asp-for="PromotionTypeId"
                        asp-items="@(List<SelectListItem>)PromotionTypeItems"
                        style="        width: 100%;">
                    <option value="0">请选择</option>
                </select>
                <span asp-validation-for="PromotionTypeId" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="StartDate" class="control-label"></label>：
                <input asp-for="StartDate" type="datetime-local" class="form-control" />
                <span asp-validation-for="StartDate" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="EndDate" class="control-label"></label>：
                <input asp-for="EndDate" type="datetime-local" class="form-control" />
                <span asp-validation-for="EndDate" class="text-danger"></span>
            </div>

            <div class="form-group">
                <label asp-for="PromotionStateId" class="control-label"></label>：<br />
                <select asp-for="PromotionStateId"
                        asp-items="@(List<SelectListItem>)PromotionStateItems"
                        style="        width: 100%;">
                </select>
                <span asp-validation-for="PromotionStateId" class="text-danger"></span>
            </div>

            <div class="form-group">
                <input asp-for="PromotionProductTypeId" type="hidden" />
                <label asp-for="PromotionProductTypeId" class="control-label"></label>：<br />
                <select disabled asp-for="PromotionProductTypeId"
                        asp-items="@(List<SelectListItem>)PromotionProductTypeItems"
                        style="        width: 100%;">
                    <option value="0">请选择</option>
                </select>
                <span asp-validation-for="PromotionProductTypeId" class="text-danger"></span>
            </div>
            <div class="form-group">
                @Html.DisplayNameFor(m => m.CreatedOnUtc)：@Html.DisplayFor(m => m.CreatedOnUtc)
            </div>
            <div class="form-group">
                创建人：admin
            </div>
            <div class="form-group">
                删除：@Html.CheckBoxFor(m => m.Deleted)
            </div>
            <input type="submit" value="确定" />
        </form>
    </div>
</div>